package id.co.rho.scoring.cid.server.command;

import id.co.rho.scoring.cid.client.command.impl.*;
import id.co.rho.scoring.cid.server.command.handler.CommandHandler;
import id.co.rho.scoring.cid.server.command.handler.impl.*;

import java.util.HashMap;

public class CommandHandlerRepository {
	public static final HashMap<Class,CommandHandler> handlerMap = new HashMap<Class, CommandHandler>();
	
	static {       
        handlerMap.put(LoginCommandAction.class, new LoginCommandHandler());		
		handlerMap.put(TypeModelConfigCommand.class, new TypeModelConfigCommandHandler());
		handlerMap.put(ModelSearchCommandAction.class, new ModelSearchCommandHandler());
		handlerMap.put(ScoringModelCommand.class, new ScoringModelHandler());
		handlerMap.put(VersioningSetDefaultCommandAction.class, new VersioningSetDefaultHandler());
	}
	
	public static CommandHandler getHandler(Class action){
		return handlerMap.get(action);
	}
}
